<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>lua_opdef</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="lua_exec.html" title="lua_exec" />
    <link rel="next" href="lua_opcall.html" title="lua_opcall" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">
            lua_opdef
        </th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="lua_exec.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="lua_opcall.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="lua_opdef"></a>
      <div class="titlepage"></div>
      <a id="Indexlua_opdef" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">
            lua_opdef
        </span>
        </h2>
        <p>
            lua_opdef
         — 
             Define an opcode in Lua at i-rate. The opcode can take any 
             number of output and/or input arguments of any type. 
        </p>
      </div>
      <div class="refsect1">
        <a id="idp122104944"></a>
        <h2>
            Description
        </h2>
        <p>
            Define an opcode in Lua at i-rate. The opcode can take any 
            number of output and/or input arguments of any type. 
            The code is executed at initialization time, typically from the 
            orchestra header. Global and local variables, functions, 
            tables, and classes may be declared and defined. Objects defined 
            at global Lua scope remain in scope throughout the performance, 
            and are visible to any other Lua code in the same Csound thread.
        </p>
        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
                <p>
               By default, all objects defined in Lua are defined at global 
               scope. In order to ensure that objects are confined to their 
               own block of code, that is to ensure that the object is visible 
               only in lexical scope, the object must be declared as local. 
               This is the feature of Lua that beginners tend to find the most 
               troublesome.
            </p>
                <p>
               Another thing to look out for is that Lua arrays use 1-based 
               indexing, not the 0-based indexing used in C and many other 
               programming languages.
            </p>
              </td>
            </tr>
          </table>
        </div>
      </div>
      <div class="refsect1">
        <a id="idp122108464"></a>
        <h2>
            Syntax
        </h2>
        <pre class="synopsis"><span class="command"><strong>lua_opdef</strong></span> Sname, Sluacode</pre>
      </div>
      <div class="refsect1">
        <a id="idp122110448"></a>
        <h2>
            Initialization
        </h2>
        <p>
            <span class="emphasis"><em>Sname</em></span> -- The name of the opcode.
        </p>
        <p>
            <span class="emphasis"><em>Sluacode</em></span> -- A block of Lua code, of any 
            length. Multi-line blocks may be enclosed in double braces
            (i.e. <code class="literal">{{ }}</code>). This code is 
            evaluated once at initialization time.  
        </p>
        <p>
            The Lua code must define all functions that will be called from Csound,
            using the following naming convention, where opcodename
            stands for the actual opcode name:
        </p>
        <div class="itemizedlist">
          <ul class="itemizedlist" style="list-style-type: disc; ">
            <li class="listitem">
                <code class="literal">opcodename_init</code> for the i-rate opcode subroutine.
            </li>
            <li class="listitem">
                <code class="literal">opcodename_kontrol</code> for the k-rate opcode subroutine.
            </li>
            <li class="listitem">
                <code class="literal">opcodename_audio</code> for the a-rate opcode subroutine.
            </li>
            <li class="listitem">
                <code class="literal">opcodename_noteoff</code> for the note-off subroutine.
            </li>
          </ul>
        </div>
        <p>
            Each of these Lua functions will receive three lightuserdata
            (i.e. pointer) arguments: the CSOUND object, the opcode instance,
            and a pointer to the opcode arguments, which the Lua code must be type cast
            to a LuaJIT FFI ctype structure containing the opcode output arguments,
            input arguments, and state variables. Using LuaJIT FFI, the elements of
            this structure will be accessible as though they were Lua types.
        </p>
        <p>
            Each of these Lua functions must return 0 for success
            or 1 for failure.
        </p>
        <p>
            The Lua functions may do absolutely anything, although of
            course if real-time performance is expected, care must be
            taken to disable Lua garbage collection and observe other
            recommendations for real-time code.
        </p>
      </div>
      <div class="refsect1">
        <a id="idp122122016"></a>
        <h2>
            Example
        </h2>
        <p>
            Here is an example of a Lua opcode, implementing a Moog 
            ladder filter. For purposes of comparison, a user-defined 
            opcode and the native Csound opcode that compute the same 
            sound using the same algorithm also are shown, and timed. 
            The example uses the file <a class="ulink" href="examples/luamoog.csd" target="_top">
            <em class="citetitle">luamoog.csd</em></a>.
            </p>
        <div class="example">
          <a id="idp122125536"></a>
          <p class="title">
            <strong>Example 462. 
                    Example of a Lua opcode.
                </strong>
          </p>
          <div class="example-contents">
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>
<span class="ohdr">sr</span> <span class="op">=</span>    48000
<span class="ohdr">ksmps</span> <span class="op">=</span>   100
<span class="ohdr">nchnls</span> <span class="op">=</span>    1

    gibegan     <span class="opc">rtclock</span>

    <span class="opc">lua_opdef</span>   "moogladder", {{
local ffi <span class="op">=</span> require("ffi")
local math <span class="op">=</span> require("math")
local string <span class="op">=</span> require("string")
local csoundApi <span class="op">=</span> ffi.load('csound64.dll.5.2')
ffi.cdef[[
    <span class="opc">int</span> csoundGetKsmps(void <span class="op">*</span>)<span class="comment">;</span>
    double csoundGetSr(void <span class="op">*</span>)<span class="comment">;</span>
    struct moogladder_t {
      double <span class="op">*</span><span class="opc">out</span><span class="comment">;</span>
      double <span class="op">*</span>inp<span class="comment">;</span>
      double <span class="op">*</span>freq<span class="comment">;</span>
      double <span class="op">*</span>res<span class="comment">;</span>
      double <span class="op">*</span>istor<span class="comment">;</span>
      double <span class="ohdr">sr</span><span class="comment">;</span>
      double <span class="ohdr">ksmps</span><span class="comment">;</span>
      double thermal<span class="comment">;</span>
      double f<span class="comment">;</span>
      double fc<span class="comment">;</span>
      double fc2<span class="comment">;</span>
      double fc3<span class="comment">;</span>
      double fcr<span class="comment">;</span>
      double acr<span class="comment">;</span>
      double tune<span class="comment">;</span>
      double res4<span class="comment">;</span>
      double input<span class="comment">;</span>
      double <span class="opc">i</span><span class="comment">;</span>
      double j<span class="comment">;</span>
      double <span class="opc">k</span><span class="comment">;</span>
      double kk<span class="comment">;</span>
      double stg[6]<span class="comment">;</span>
      double delay[6]<span class="comment">;</span>
      double tanhstg[6]<span class="comment">;</span>
    }<span class="comment">;</span>
]]

local moogladder_ct <span class="op">=</span> ffi.typeof('struct moogladder_t <span class="op">*</span>')

function moogladder_init(csound, opcode, carguments)
    local <span class="opc">p</span> <span class="op">=</span> ffi.cast(moogladder_ct, carguments)
    p.sr <span class="op">=</span> csoundApi.csoundGetSr(csound)
    p.ksmps <span class="op">=</span> csoundApi.csoundGetKsmps(csound)
    <span class="octrl">if</span> p.istor[0] <span class="op">==</span> 0 then
        for <span class="opc">i</span> <span class="op">=</span> 0, 5 do
            p.delay[i] <span class="op">=</span> 0.0
        end
        for <span class="opc">i</span> <span class="op">=</span> 0, 3 do
            p.tanhstg[i] <span class="op">=</span> 0.0
        end
    end
    <span class="opc">return</span> 0
end

function moogladder_kontrol(csound, opcode, carguments)
    local <span class="opc">p</span> <span class="op">=</span> ffi.cast(moogladder_ct, carguments)
    <span class="op">-</span><span class="op">-</span> transistor thermal voltage
    p.thermal <span class="op">=</span> 1.0 <span class="op">/</span> 40000.0
    <span class="octrl">if</span> p.res[0] <span class="op">&lt;</span> 0.0 then
        p.res[0] <span class="op">=</span> 0.0
    end
    <span class="op">-</span><span class="op">-</span> <span class="ohdr">sr</span> is half the actual filter sampling rate
    p.fc <span class="op">=</span> p.freq[0] <span class="op">/</span> p.sr
    p.f <span class="op">=</span> p.fc <span class="op">/</span> 2.0
    p.fc2 <span class="op">=</span> p.fc <span class="op">*</span> p.fc
    p.fc3 <span class="op">=</span> p.fc2 <span class="op">*</span> p.fc
    <span class="op">-</span><span class="op">-</span> frequency <span class="op">&amp;</span> amplitude correction
    p.fcr <span class="op">=</span> 1.873 <span class="op">*</span> p.fc3 <span class="op">+</span> 0.4955 <span class="op">*</span> p.fc2 <span class="op">-</span> 0.6490 <span class="op">*</span> p.fc <span class="op">+</span> 0.9988
    p.acr <span class="op">=</span> <span class="op">-</span>3.9364 <span class="op">*</span> p.fc2 <span class="op">+</span> 1.8409 <span class="op">*</span> p.fc <span class="op">+</span> 0.9968
    <span class="op">-</span><span class="op">-</span> filter tuning
    p.tune <span class="op">=</span> (1.0 <span class="op">-</span> math.exp(<span class="op">-</span>(2.0 <span class="op">*</span> math.pi <span class="op">*</span> p.f <span class="op">*</span> p.fcr))) <span class="op">/</span> p.thermal
    p.res4 <span class="op">=</span> 4.0 <span class="op">*</span> p.res[0] <span class="op">*</span> p.acr
    <span class="op">-</span><span class="op">-</span> Nested 'for' loops crash, not sure why.
    <span class="op">-</span><span class="op">-</span> Local loop variables also are problematic.
    <span class="op">-</span><span class="op">-</span> Lower<span class="op">-</span>level loop constructs don't crash.
    p.i <span class="op">=</span> 0
    while p.i <span class="op">&lt;</span> p.ksmps do
        p.j <span class="op">=</span> 0
        while p.j <span class="op">&lt;</span> 2 do
            p.k <span class="op">=</span> 0
            while p.k <span class="op">&lt;</span> 4 do
                <span class="octrl">if</span> p.k <span class="op">==</span> 0 then
                    p.input <span class="op">=</span> p.inp[p.i] <span class="op">-</span> p.res4 <span class="op">*</span> p.delay[5]
                    p.stg[p.k] <span class="op">=</span> p.delay[p.k] <span class="op">+</span> p.tune <span class="op">*</span> (math.tanh(p.input <span class="op">*</span> p.thermal) <span class="op">-</span> p.tanhstg[p.k])
                <span class="octrl">else</span>
                    p.input <span class="op">=</span> p.stg[p.k <span class="op">-</span> 1]
                    p.tanhstg[p.k <span class="op">-</span> 1] <span class="op">=</span> math.tanh(p.input <span class="op">*</span> p.thermal)
                    <span class="octrl">if</span> p.k <span class="op">&lt;</span> 3 then
                        p.kk <span class="op">=</span> p.tanhstg[p.k]
                    <span class="octrl">else</span>
                        p.kk <span class="op">=</span> math.tanh(p.delay[p.k] <span class="op">*</span> p.thermal)
                    end
                    p.stg[p.k] <span class="op">=</span> p.delay[p.k] <span class="op">+</span> p.tune <span class="op">*</span> (p.tanhstg[p.k <span class="op">-</span> 1] <span class="op">-</span> p.kk)
                end
                p.delay[p.k] <span class="op">=</span> p.stg[p.k]
                p.k <span class="op">=</span> p.k <span class="op">+</span> 1
            end
            <span class="op">-</span><span class="op">-</span> 1<span class="op">/</span>2<span class="op">-</span>sample <span class="opc">delay</span> for phase compensation
            p.delay[5] <span class="op">=</span> (p.stg[3] <span class="op">+</span> p.delay[4]) <span class="op">*</span> 0.5
            p.delay[4] <span class="op">=</span> p.stg[3]
            p.j <span class="op">=</span> p.j <span class="op">+</span> 1
        end
        p.out[p.i] <span class="op">=</span> p.delay[5]
        p.i <span class="op">=</span> p.i <span class="op">+</span> 1
    end
    <span class="opc">return</span> 0
end
}}

<span class="op">/</span><span class="op">*</span>
Moogladder <span class="op">-</span> An improved implementation of the Moog ladder filter

DESCRIPTION
This is an new digital implementation of the Moog ladder filter based on the work of Antti Huovilainen,
described <span class="opc">in</span> the paper \"Non<span class="op">-</span>Linear Digital Implementation of the Moog Ladder Filter\" (Proceedings of DaFX04, Univ of Napoli).
This implementation is probably <span class="opc">a</span> more accurate digital representation of the original analogue filter.
This is version 2 (revised 14<span class="op">/</span>DEC<span class="op">/</span>04), with improved amplitude<span class="op">/</span>resonance scaling and frequency correction using <span class="opc">a</span> couple of polynomials,as suggested by Antti.

SYNTAX
ar  Moogladder  asig, kcf, kres

PERFORMANCE
asig <span class="op">-</span> input signal
kcf <span class="op">-</span> cutoff frequency (Hz)
kres <span class="op">-</span> resonance (0 <span class="op">-</span> 1).

CREDITS
Victor Lazzarini
<span class="op">*</span><span class="op">/</span>

                    <span class="oblock">opcode</span>  moogladderu, a, akk
asig, kcf, kres     <span class="opc">xin</span>
                    <span class="opc">setksmps</span>    1
ipi                 <span class="op">=</span>           4 <span class="op">*</span> <span class="opc">taninv</span>(1)
<span class="op">/</span><span class="op">*</span> filter delays <span class="op">*</span><span class="op">/</span>
az1                 <span class="opc">init</span>        0
az2                 <span class="opc">init</span>        0
az3                 <span class="opc">init</span>        0
az4                 <span class="opc">init</span>        0
az5                 <span class="opc">init</span>        0
ay4                 <span class="opc">init</span>        0
amf                 <span class="opc">init</span>        0
                    <span class="octrl">if</span>          kres <span class="op">&gt;</span> 1 then
kres                <span class="op">=</span>           1
                    <span class="octrl">elseif</span>      kres <span class="op">&lt;</span> 0 then
kres                <span class="op">=</span>           0
                    <span class="octrl">endif</span>
<span class="op">/</span><span class="op">*</span> twice the \'thermal voltage of <span class="opc">a</span> transistor\' <span class="op">*</span><span class="op">/</span>
i2v                 <span class="op">=</span>           40000
<span class="op">/</span><span class="op">*</span> <span class="ohdr">sr</span> is half the actual filter sampling rate  <span class="op">*</span><span class="op">/</span>
kfc                 <span class="op">=</span>           kcf<span class="op">/</span><span class="ohdr">sr</span>
kf                  <span class="op">=</span>           kcf<span class="op">/</span>(<span class="ohdr">sr</span><span class="op">*</span>2)
<span class="op">/</span><span class="op">*</span> frequency <span class="op">&amp;</span> amplitude correction  <span class="op">*</span><span class="op">/</span>
kfcr                <span class="op">=</span>           1.8730 <span class="op">*</span> (kfc^3) <span class="op">+</span> 0.4955 <span class="op">*</span> (kfc^2) <span class="op">-</span> 0.6490 <span class="op">*</span> kfc <span class="op">+</span> 0.9988
kacr                <span class="op">=</span>           <span class="op">-</span>3.9364 <span class="op">*</span> (kfc^2) <span class="op">+</span> 1.8409 <span class="op">*</span> kfc <span class="op">+</span> 0.9968<span class="comment">;</span>
<span class="op">/</span><span class="op">*</span> filter tuning  <span class="op">*</span><span class="op">/</span>
k2vg                <span class="op">=</span>           i2v <span class="op">*</span> (1 <span class="op">-</span> <span class="opc">exp</span>(<span class="op">-</span>2 <span class="op">*</span> ipi <span class="op">*</span> kfcr <span class="op">*</span> kf))
<span class="op">/</span><span class="op">*</span> cascade of 4 1st order sections         <span class="op">*</span><span class="op">/</span>
ay1                 <span class="op">=</span>           az1 <span class="op">+</span> k2vg <span class="op">*</span> (<span class="opc">tanh</span>((asig <span class="op">-</span> 4 <span class="op">*</span> kres <span class="op">*</span> amf <span class="op">*</span> kacr) <span class="op">/</span> i2v) <span class="op">-</span> <span class="opc">tanh</span>(az1 <span class="op">/</span> i2v))
az1                 <span class="op">=</span>           ay1
ay2                 <span class="op">=</span>           az2 <span class="op">+</span> k2vg <span class="op">*</span> (<span class="opc">tanh</span>(ay1 <span class="op">/</span> i2v) <span class="op">-</span> <span class="opc">tanh</span>(az2 <span class="op">/</span> i2v ))
az2                 <span class="op">=</span>           ay2
ay3                 <span class="op">=</span>           az3 <span class="op">+</span> k2vg <span class="op">*</span> (<span class="opc">tanh</span>(ay2 <span class="op">/</span> i2v) <span class="op">-</span> <span class="opc">tanh</span>(az3 <span class="op">/</span> i2v))
az3                 <span class="op">=</span>           ay3
ay4                 <span class="op">=</span>           az4 <span class="op">+</span> k2vg <span class="op">*</span> (<span class="opc">tanh</span>(ay3 <span class="op">/</span> i2v) <span class="op">-</span> <span class="opc">tanh</span>(az4 <span class="op">/</span> i2v))
az4                 <span class="op">=</span>           ay4
<span class="op">/</span><span class="op">*</span> 1<span class="op">/</span>2<span class="op">-</span>sample <span class="opc">delay</span> for phase compensation  <span class="op">*</span><span class="op">/</span>
amf                 <span class="op">=</span>           (ay4 <span class="op">+</span> az5) <span class="op">*</span>0.5
az5                 <span class="op">=</span>           ay4
<span class="op">/</span><span class="op">*</span> oversampling  <span class="op">*</span><span class="op">/</span>
ay1                 <span class="op">=</span>           az1 <span class="op">+</span> k2vg <span class="op">*</span> (<span class="opc">tanh</span>((asig <span class="op">-</span> 4 <span class="op">*</span> kres <span class="op">*</span> amf <span class="op">*</span> kacr) <span class="op">/</span> i2v) <span class="op">-</span> <span class="opc">tanh</span>(az1 <span class="op">/</span> i2v))
az1                 <span class="op">=</span>           ay1
ay2                 <span class="op">=</span>           az2 <span class="op">+</span> k2vg <span class="op">*</span> (<span class="opc">tanh</span>(ay1 <span class="op">/</span> i2v) <span class="op">-</span> <span class="opc">tanh</span>(az2 <span class="op">/</span> i2v ))
az2                 <span class="op">=</span>           ay2
ay3                 <span class="op">=</span>           az3 <span class="op">+</span> k2vg <span class="op">*</span> (<span class="opc">tanh</span>(ay2 <span class="op">/</span> i2v) <span class="op">-</span> <span class="opc">tanh</span>(az3 <span class="op">/</span> i2v))
az3                 <span class="op">=</span>           ay3
ay4                 <span class="op">=</span>           az4 <span class="op">+</span> k2vg <span class="op">*</span> (<span class="opc">tanh</span>(ay3 <span class="op">/</span> i2v) <span class="op">-</span> <span class="opc">tanh</span>(az4 <span class="op">/</span> i2v))
az4                 <span class="op">=</span>           ay4
amf                 <span class="op">=</span>           (ay4 <span class="op">+</span> az5) <span class="op">*</span> 0.5
az5                 <span class="op">=</span>           ay4
                    <span class="opc">xout</span>        amf
                    <span class="oblock">endop</span>

<span class="oblock">instr</span> 1
                <span class="opc">prints</span>      "No filter.\n"
	kfe         <span class="opc">expseg</span>      500, p3<span class="op">*</span>0.9, 1800, p3<span class="op">*</span>0.1, 3000
    kenv        <span class="opc">linen</span>       10000, 0.05, p3, 0.05
    asig        <span class="opc">buzz</span>        kenv, 100, <span class="ohdr">sr</span><span class="op">/</span>(200), 1
    <span class="comment">; afil      moogladder  asig, kfe, 1</span>
                <span class="opc">out</span>         asig
<span class="oblock">endin</span>

<span class="oblock">instr</span> 2
                <span class="opc">prints</span>      "Native moogladder.\n"
	kfe         <span class="opc">expseg</span>      500, p3<span class="op">*</span>0.9, 1800, p3<span class="op">*</span>0.1, 3000
    kenv        <span class="opc">linen</span>       10000, 0.05, p3, 0.05
    asig        <span class="opc">buzz</span>        kenv, 100, <span class="ohdr">sr</span><span class="op">/</span>(200), 1
    afil        <span class="opc">moogladder</span>  asig, kfe, 1
                <span class="opc">out</span>         afil
<span class="oblock">endin</span>

<span class="oblock">instr</span> 3
                <span class="opc">prints</span>      "UDO moogladder.\n"
	kfe         <span class="opc">expseg</span>      500, p3<span class="op">*</span>0.9, 1800, p3<span class="op">*</span>0.1, 3000
    kenv        <span class="opc">linen</span>       10000, 0.05, p3, 0.05
    asig        <span class="opc">buzz</span>        kenv, 100, <span class="ohdr">sr</span><span class="op">/</span>(200), 1
    afil        moogladderu asig, kfe, 1
                <span class="opc">out</span>         afil
<span class="oblock">endin</span>

<span class="oblock">instr</span> 4
                <span class="opc">prints</span>      "Lua moogladder.\n"
    kres        <span class="opc">init</span>        1
    istor       <span class="opc">init</span>        0
	kfe         <span class="opc">expseg</span>      500, p3<span class="op">*</span>0.9, 1800, p3<span class="op">*</span>0.1, 3000
    kenv        <span class="opc">linen</span>       10000, 0.05, p3, 0.05
    asig        <span class="opc">buzz</span>        kenv, 100, <span class="ohdr">sr</span><span class="op">/</span>(200), 1
    afil        <span class="opc">init</span>        0
                <span class="opc">lua_ikopcall</span>    "moogladder", afil, asig, kfe, kres, istor
                <span class="opc">out</span>         afil
<span class="oblock">endin</span>

<span class="oblock">instr</span> 5
    giended     <span class="opc">rtclock</span>
    ielapsed    <span class="op">=</span>           giended <span class="op">-</span> gibegan
                <span class="opc">print</span>       ielapsed
    gibegan     <span class="opc">rtclock</span>
<span class="oblock">endin</span>

<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="stamnt">f</span> 1     0 65536 10 1
<span class="stamnt">i</span> 5.1   0   1
<span class="stamnt">i</span> 4     1   20
<span class="stamnt">i</span> 5.2   21  1
<span class="stamnt">i</span> 4     22  20
<span class="stamnt">i</span> 5.3   42  1
<span class="stamnt">i</span> 2     43  20
<span class="stamnt">i</span> 5.4   63  1
<span class="stamnt">i</span> 2     64  20
<span class="stamnt">i</span> 5.5   84  1
<span class="stamnt">i</span> 3     85  20
<span class="stamnt">i</span> 5.6   105 1
<span class="stamnt">i</span> 3     106 20
<span class="stamnt">i</span> 5.7   126 1
<span class="stamnt">i</span> 1     127 20
<span class="stamnt">i</span> 5.8   147 1
<span class="stamnt">i</span> 1     148 20
<span class="stamnt">i</span> 5.9   168 1
<span class="stamnt">i</span> 4     169 20
<span class="stamnt">i</span> 4     170 20
<span class="stamnt">i</span> 4     171 20
<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
        </p>
      </div>
      <div class="refsect1">
        <a id="idp122127248"></a>
        <h2>
            See Also
        </h2>
        <p>
            <a class="link" href="lua_exec.html" title="lua_exec"><em class="citetitle">lua_exec</em></a>, 
            <a class="link" href="lua_opcall.html" title="lua_opcall"><em class="citetitle">lua_opcall</em></a>. 
        </p>
      </div>
      <div class="refsect1">
        <a id="idp122130304"></a>
        <h2>
            Credits
        </h2>
        <p>
            By: Michael Gogins 2011
        </p>
        <p>
            New in Csound version 5.13.2
        </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="lua_exec.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="lua_opcall.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">
            lua_exec
         </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> 
            lua_opcall
        </td>
        </tr>
      </table>
    </div>
  </body>
</html>
